package com.ruoyi.web.controller.marketing;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.marketing.service.IMarketActivityUserService;
import com.ruoyi.marketing.vo.ActivityUserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: renSen
 * @Date: 2023/01/29
 * @Description:
 */
@RestController
@RequestMapping("/activityUser")
public class MarketActivityUserController extends BaseController {
    @Autowired
    private IMarketActivityUserService marketActivityUserService;

    @GetMapping("/list")
    public TableDataInfo listMap(ActivityUserVo vo) {
        startPage();
        List<ActivityUserVo> list = marketActivityUserService.list(vo);
        return getDataTable(list);
    }

    @GetMapping("/{id}")
    public AjaxResult listUserDetail(@PathVariable("id") Long id) {
        return AjaxResult.success(marketActivityUserService.listUserDetail(id));
    }

    @GetMapping("/prize/{userId}/{activityId}")
    public AjaxResult listPrizeDetail(@PathVariable("userId") Long userId, @PathVariable("activityId") Long activityId) {
        return AjaxResult.success(marketActivityUserService.listPrizeDetail(userId,activityId));
    }
}
